.class public Lrexsee/dialog/RexseeButtonDialog;
.super Ljava/lang/Object;
.source "RexseeButtonDialog.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final EVENT_ONBUTTONDIALOGDISMISSED:Ljava/lang/String; = "onButtonDialogDismissed"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "ButtonDialog"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;

.field private final mMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lrexsee/dialog/ButtonDialog;",
            ">;"
        }
    .end annotation
.end field

.field private syncTag:Z


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 38
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 35
    const/4 v0, 0x0

    iput-boolean v0, p0, Lrexsee/dialog/RexseeButtonDialog;->syncTag:Z

    .line 39
    iput-object p1, p0, Lrexsee/dialog/RexseeButtonDialog;->mBrowser:Lrexsee/core/browser/Browser;

    .line 40
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mContext:Landroid/content/Context;

    .line 41
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    .line 42
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onButtonDialogDismissed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 43
    return-void
.end method

.method static synthetic access$0(Lrexsee/dialog/RexseeButtonDialog;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 32
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/dialog/RexseeButtonDialog;)Ljava/util/HashMap;
    .locals 1

    .prologue
    .line 34
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    return-object v0
.end method

.method static synthetic access$2(Lrexsee/dialog/RexseeButtonDialog;Z)V
    .locals 0

    .prologue
    .line 35
    iput-boolean p1, p0, Lrexsee/dialog/RexseeButtonDialog;->syncTag:Z

    return-void
.end method


# virtual methods
.method public dismiss(Ljava/lang/String;)V
    .locals 2
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 90
    iget-object v1, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 94
    :goto_0
    return-void

    .line 91
    :cond_0
    iget-object v1, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lrexsee/dialog/ButtonDialog;

    .line 92
    .local v0, "dialog":Lrexsee/dialog/ButtonDialog;
    if-eqz v0, :cond_1

    invoke-virtual {v0}, Lrexsee/dialog/ButtonDialog;->dismiss()V

    .line 93
    :cond_1
    iget-object v1, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0
.end method

.method public dismissAll()V
    .locals 5

    .prologue
    .line 96
    iget-object v4, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v3

    .line 97
    .local v3, "keys":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 98
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/lang/String;>;"
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_1

    .line 103
    iget-object v4, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4}, Ljava/util/HashMap;->clear()V

    .line 104
    return-void

    .line 99
    :cond_1
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 100
    .local v2, "key":Ljava/lang/String;
    iget-object v4, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lrexsee/dialog/ButtonDialog;

    .line 101
    .local v0, "dialog":Lrexsee/dialog/ButtonDialog;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lrexsee/dialog/ButtonDialog;->dismiss()V

    goto :goto_0
.end method

.method public exists(Ljava/lang/String;)Z
    .locals 1
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 113
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public getIds()Ljava/lang/String;
    .locals 6

    .prologue
    const-string v5, "\""

    .line 119
    const-string v2, ""

    .line 120
    .local v2, "rtn":Ljava/lang/String;
    iget-object v3, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    .line 121
    .local v0, "ids":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 122
    .end local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/lang/String;>;"
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_0

    .line 126
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "["

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "]"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    return-object v3

    .line 123
    :cond_0
    const-string v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ","

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 124
    :cond_1
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, "\""

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Ljava/lang/String;

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\""

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    goto :goto_0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 23
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 19
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/dialog/RexseeButtonDialog;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "ButtonDialog"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 27
    return-object p0
.end method

.method public getStyle(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "name"    # Ljava/lang/String;

    .prologue
    .line 110
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, ""

    .end local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    :goto_0
    return-object v0

    .restart local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    :cond_0
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    check-cast p0, Lrexsee/dialog/ButtonDialog;

    invoke-virtual {p0, p2}, Lrexsee/dialog/ButtonDialog;->getStyle(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public setStyle(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;

    .prologue
    .line 106
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 108
    .end local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    :goto_0
    return-void

    .line 107
    .restart local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    :cond_0
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/dialog/RexseeButtonDialog;
    check-cast p0, Lrexsee/dialog/ButtonDialog;

    invoke-virtual {p0, p2}, Lrexsee/dialog/ButtonDialog;->setStyle(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "menuIds"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;

    .prologue
    .line 48
    const/4 v0, 0x0

    invoke-virtual {p0, v0, p1, p2}, Lrexsee/dialog/RexseeButtonDialog;->show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 49
    return-void
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 6
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "menuIds"    # Ljava/lang/String;
    .param p3, "style"    # Ljava/lang/String;

    .prologue
    .line 51
    if-eqz p1, :cond_1

    move-object v0, p1

    .line 52
    .local v0, "dialogId":Ljava/lang/String;
    :goto_0
    const-string v4, ","

    invoke-virtual {p2, v4}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    .line 53
    .local v2, "ids":[Ljava/lang/String;
    array-length v4, v2

    if-nez v4, :cond_2

    .line 87
    :cond_0
    return-void

    .end local v0    # "dialogId":Ljava/lang/String;
    .end local v2    # "ids":[Ljava/lang/String;
    :cond_1
    move-object v0, p2

    .line 51
    goto :goto_0

    .line 54
    .restart local v0    # "dialogId":Ljava/lang/String;
    .restart local v2    # "ids":[Ljava/lang/String;
    :cond_2
    array-length v4, v2

    new-array v3, v4, [Lrexsee/core/menu/PopMenu;

    .line 55
    .local v3, "menus":[Lrexsee/core/menu/PopMenu;
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_1
    array-length v4, v2

    if-lt v1, v4, :cond_3

    .line 58
    iget-object v4, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4, v0}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_0

    .line 59
    const/4 v4, 0x0

    iput-boolean v4, p0, Lrexsee/dialog/RexseeButtonDialog;->syncTag:Z

    .line 60
    iget-object v4, p0, Lrexsee/dialog/RexseeButtonDialog;->mContext:Landroid/content/Context;

    check-cast v4, Landroid/app/Activity;

    new-instance v5, Lrexsee/dialog/RexseeButtonDialog$1;

    invoke-direct {v5, p0, v0, p3, v3}, Lrexsee/dialog/RexseeButtonDialog$1;-><init>(Lrexsee/dialog/RexseeButtonDialog;Ljava/lang/String;Ljava/lang/String;[Lrexsee/core/menu/PopMenu;)V

    invoke-virtual {v4, v5}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 80
    :goto_2
    iget-boolean v4, p0, Lrexsee/dialog/RexseeButtonDialog;->syncTag:Z

    if-nez v4, :cond_0

    .line 82
    const-wide/16 v4, 0x64

    :try_start_0
    invoke-static {v4, v5}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    .line 83
    :catch_0
    move-exception v4

    goto :goto_2

    .line 56
    :cond_3
    iget-object v4, p0, Lrexsee/dialog/RexseeButtonDialog;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v4, v4, Lrexsee/core/browser/Browser;->menu:Lrexsee/core/menu/RexseeMenu;

    iget-object v4, v4, Lrexsee/core/menu/RexseeMenu;->menus:Lrexsee/core/menu/PopMenus;

    aget-object v5, v2, v1

    invoke-virtual {v4, v5}, Lrexsee/core/menu/PopMenus;->get(Ljava/lang/String;)Lrexsee/core/menu/PopMenu;

    move-result-object v4

    aput-object v4, v3, v1

    .line 55
    add-int/lit8 v1, v1, 0x1

    goto :goto_1
.end method

.method public size()I
    .locals 1

    .prologue
    .line 116
    iget-object v0, p0, Lrexsee/dialog/RexseeButtonDialog;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->size()I

    move-result v0

    return v0
.end method
